package ssm_zxw.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ssm_zxw.mapper.userMapper;
import ssm_zxw.pojo.User;
import ssm_zxw.service.userService;

import java.util.List;
@Service("userMapperService")
public class userServiceImpl implements userService {
    @Autowired
    private userMapper userMapper;
    public List<User> findAll(){
   //System.out.println(userMapper.findAll());
        return userMapper.findAll();
    }

    public List<User> find(){
        return userMapper.find();
    }

    public void deleteUser_role(int id){
        userMapper.deleteUser_role(id);
        userMapper.deleteUser(id);
    }

    @Override
    public User finUserByPassword(String username, String password) {
        User user = userMapper.findNameByPassword(username, password);
        return user;
    }
}
